package com.d3works.apps.account.service;

import com.d3works.apps.account.db.Account;
import com.d3works.apps.account.db.AccountingReport;
import com.d3works.exception.D3worksException;
import com.d3works.meta.db.MetaFile;
import com.google.inject.persist.Transactional;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Map;

public interface AccountingReportService {

  String print(AccountingReport accountingReport) throws D3worksException, IOException;

  MetaFile export(AccountingReport accountingReport) throws D3worksException, IOException;

  public String getMoveLineList(AccountingReport accountingReport) throws D3worksException;

  public String buildQuery(AccountingReport accountingReport) throws D3worksException;

  public String addParams(String paramQuery, Object param);

  public String addParams(String paramQuery);

  @Transactional
  public void setSequence(AccountingReport accountingReport, String sequence);

  public String getSequence(AccountingReport accountingReport) throws D3worksException;

  public Account getAccount(AccountingReport accountingReport);

  @Transactional
  public void setStatus(AccountingReport accountingReport);

  /**
   * @param queryFilter
   * @return
   */
  public BigDecimal getDebitBalance();

  /**
   * @param queryFilter
   * @return
   */
  public BigDecimal getCreditBalance();

  public BigDecimal getDebitBalanceType4();

  public BigDecimal getCreditBalance(AccountingReport accountingReport, String queryFilter);

  public BigDecimal getCreditBalanceType4();

  public boolean isThereTooManyLines(AccountingReport accountingReport) throws D3worksException;

  public void testReportedDateField(LocalDate reportedDate) throws D3worksException;

  public AccountingReport createAccountingExportFromReport(
      AccountingReport accountingReport, int exportTypeSelect, boolean isComplementary)
      throws D3worksException;

  /**
   * Method to get fields from ReportTypeModelAccountingReport
   *
   * @param accountingReport the accouting report linked to the ReportTypeModelAccountingReport
   * @return map if ReportTypeModelAccountingReport is found else null
   * @throws D3worksException
   */
  public Map<String, Object> getFieldsFromReportTypeModelAccountingReport(
      AccountingReport accountingReport) throws D3worksException;
}
